<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <div id="app">
    <button v-show="index > 0" @click="index--">上一页</button>
    <div><img :src="list[index]" alt=""></div>
    <button v-show="index < list.length - 1" @click="index++">下一页</button>
  </div>

  <script src=" ../vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        index: 0,
        list: [
          '../images/1.jpg',
          '../images/2.jpg',
          '../images/3.jpg',
          '../images/4.jpg',
        ]
      },
      methods: {
        fn() {
          alert('你好')
        }
      }
    })
  </script>
</body>

</html>